<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div class="time"></div>


  <script>
    function parseDate(date) {
      const h = date.getHours() + ""
      const m = date.getMinutes()  + ""
      const s = date.getSeconds() + ""
      return `${h.padStart(2, "0")}:${m.padStart(2, "0")}:${s.padStart(2, "0")}`
    }

    setInterval(() => {
      const current = new Date()
      document.querySelector(".time").innerText = parseDate(current)
    })

  </script>
</body>
</html>
